<!DOCTYPE html>
<html>
  <head>
    <title><%= username %></title>
    <link rel='stylesheet' href='/stylesheets/style.css' />
  </head>
  <body>
    <div>
      <a href="/">回到首页</a>
      <span> <%= username %></span>
      <a href="/write">写文章</a>
      <a href="/users/logout">退出</a>
    </div>

    <div>
      <div>
        <span> 序号</span>
        <span>用户名</span>
        <span>文章标题</span>
        <span>时间</span><br>
        <% data.list.map((item , index)=>{ %>
        <span> <%= index+1 %></span>
        <span><%= item.username %></span>
        <span><a href="/detail?id=<%=item.id%>"><%= item.title %></a></span>
        <span><%= item.id %></span>
        <span>
          <a href="/write?id=<%=item.id%>&page=<%=data.curpage %>">编辑</a>
          <a href="/article/delete?id=<%=item.id%>&page=<%=data.curpage %>">删除</a>
        </span><br>
        <% }) %>

        <div>
          <% for(let i=1; i<=data.total ;i++){ %>
          <a href="/?page=<%=i%>"> <%= i %> </a>
          <% } %>
        </div>
      </div>
    </div>
  </body>
</html>
